package com.itheima.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/books")
public class BookController {

    @Value("${user[1].name}")
    private String name;

    @Value("${student.name}")
    private String getName;

    @Value("${address}")
    private String address;

    @Value("${a.b.c.d.e}")
    private String shuju;


    @GetMapping("/{id}")
    public String getById(@PathVariable Integer id) {
        System.out.println("name=====>" + name);
        System.out.println("id==>" + id);
        return "hello, springboot!";
    }

    @GetMapping
    public void get() {
        System.out.println(name);
        System.out.println(getName);
        System.out.println(address);
        System.out.println(shuju);
    }
}